<template>
  <div class="error-page">
    <div class="content-con">
      <img :src="src" alt="401" />
      <div class="text-con">
        <h4>401</h4>
        <h5>Oh~~您还没登陆,请先登陆！~</h5>
      </div>
      <div>
        <Button size="large" type="text" @click="login">请登录</Button>
        <Button size="large" type="text" @click="login">请登录</Button>
      </div>
    </div>
  </div>
</template>

<script>
import error401 from '@/assets/images/error-page/error-401.svg'
import errorContent from './error-content.vue'
export default {
  name: 'error_401',
  components: {
    errorContent,
  },
  data() {
    return {
      src: error401,
    }
  },
  methods: {
    login() {
      let currentURL = window.location.href
      currentURL = currentURL.replace('error/401', '')
      let loginUrl = encodeURIComponent(currentURL)
      window.location.href = this.$config.loginUrl + '?redirect_uri=' + loginUrl
    },
  },
}
</script>
